﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

namespace UserControls
{
    public struct Url 
    {
        public string Title { get; set; }
        public string Address { get; set; }
    }
    public partial class MenuLinkList : System.Web.UI.UserControl
    {
        public string Font { get; set; } 
        public List<Url> Links { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Page.IsPostBack == false) 
            {
                this.MenuList.DataSource = Links;
                this.MenuList.DataBind();
                this.MenuList.Font.Name = Font;
                foreach (var link in this.MenuList.Controls)
                {
                    if (link is DataListItem)
                    {
                        ((HyperLink)((DataListItem)link).FindControl("MenuItem")).ForeColor = Color.Red;
                        
                    }
                }
            }
        }
    }
}